package com.example.zp.liaotian;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.jbmsuppliers.R;
import com.example.jbmsuppliers.sinopec.view.CircleImageView;


/**
 * Created by donar_work on 2017/3/28.
 */

public class Personal_InformationActivity extends Activity {
    private CircleImageView im_head_portrait;
    private TextView tv_address,tv_name;
    private Button btn_sendmsg;
    private int to_id,local_id,cg_id;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.personal_info);
        im_head_portrait = (CircleImageView) findViewById(R.id.nameimage);
        tv_address = (TextView) findViewById(R.id.tv_address);
        btn_sendmsg = (Button) findViewById(R.id.btn_sendmsg);
        tv_name = (TextView) findViewById(R.id.tv_name);
        im_head_portrait.setOnClickListener(new ClickBtn());
        btn_sendmsg.setOnClickListener(new ClickBtn());
        Intent intent = getIntent();
        to_id = intent.getExtras().getInt("t_ID");
        local_id = intent.getExtras().getInt("local_id");
        tv_name.setText(String.valueOf(to_id));
    }
    class ClickBtn implements View.OnClickListener {

        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.nameimage:
                    break;
                case R.id.btn_sendmsg:
                        Intent intent = new Intent();
                        Bundle bundle = new Bundle();
                        bundle.putInt("t_ID", to_id);
                        bundle.putInt("local_id", local_id);
                        intent.putExtras(bundle);
                        intent.setClass(Personal_InformationActivity.this, MainActivity.class);
                        startActivity(intent);
                        finish();
                    break;
            }
        }
    }
}
